<?php

namespace app\api\Logic;

use app\api\model\CampusCostModel;
use think\db\exception\DataNotFoundException;
use think\db\exception\ModelNotFoundException;
use think\exception\DbException;

class CampusCostLogic
{
    /**
     * 费用详情
     * @param $costId
     * @return array
     * @throws DataNotFoundException
     * @throws DbException
     * @throws ModelNotFoundException
     */
    public function costInfo($costId){
        $info = CampusCostModel::where('id',$costId)
            ->field('id,name,price')
            ->find();
        return objToArray($info) ?? [];
    }
}
